<% add_decidim_meta_tags(
  description: translated_attribute(current_participatory_space.short_description),
  title: t("decidim.components.pagination.page_title",
           component_name: component_name,
           current_page: paginated_debates.current_page,
           total_pages: paginated_debates.total_pages ),
  url: debates_url,
  resource: current_component) %>

<% content_for :aside do %>
  <h1 class="title-decorator"><%= component_name %></h1>

  <% if current_settings.creation_enabled? && current_component.participatory_space.can_participate?(current_user) %>
    <%= action_authorized_link_to :create, new_debate_path, permissions_holder: current_component, class: "button button__xl button__secondary w-full", data: { "redirect_url" => new_debate_path } do %>
      <span><%= t(".new_debate") %></span>
      <%= icon "add-fill" %>
    <% end %>
  <% end %>

  <%= render layout: "decidim/shared/filters", locals: { filter_sections:, search_variable:, skip_to_id: "debates" } do %>
    <%= hidden_field_tag :order, order, id: nil, class: "order_filter" %>
  <% end %>
<% end %>

<%= render layout: "layouts/decidim/shared/layout_two_col" do %>
  <%= render partial: "decidim/shared/component_announcement" %>

  <section id="debates" class="layout-main__section layout-main__heading">
    <%= render partial: "debates" %>
  </section>
<% end %>
